<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">

<TITLE>Switch -MD[x]&lt;size&gt;[k,m,g] - select the dictionary size</TITLE>
<link href="style.css" rel="stylesheet" type="text/css">
</HEAD>

<BODY>

<P class="title">Switch <B>-MD[x]&lt;size&gt;[k,m,g]</B>
-  select the dictionary size<hr></P>

<p>Sliding dictionary is the memory area used by compression algorithm
to find and compress repeated data patterns. If size of file to compress,
or total files size in case of solid archive, is larger than dictionary size,
increasing the dictionary is likely to increase the compression ratio,
reduce the archiving speed and increase memory requirements.</p>

<p>For RAR 5.0 archive format the dictionary size can be:
128 KB, 256 KB, 512 KB, 1 MB, 2 MB, 4 MB, 8 MB, 16 MB, 32 MB, 64 MB, 128 MB,
256 MB, 512 MB, 1 GB, 2 GB, 4 GB.</p>

<p>WinRAR 7.0 extends the maximum dictionary size up to 64 GB and permits
not power of 2 sizes for dictionaries exceeding 4 GB.
Such archives can be unpacked by WinRAR 7.0 and newer.</p>

<p>By default, WinRAR refuses to unpack archives with dictionary exceeding
4 GB. It is done to prevent the unexpected large memory allocation.
It is possible to change the default limit in
<a href="HELPCompressionSettings.htm#DictLimit">Compression settings</a>
or use -md&lt;size&gt; or -mdx&lt;size&gt; to allow unpacking dictionaries
up to and including the specified size. Unlike -md&lt;size&gt;,
-mdx&lt;size&gt; is applied to extraction only and can be added to
<a href="HELPRARIni.htm">rar.ini file</a> or <a href="HELPRARVar.htm">
RARINISWITCHES environment variable</a>, not affecting archiving commands.</p>

<p>'k', 'm' and 'g' modifiers placed after the size, set kilobyte,
megabyte and gigabyte units, like -md64m for 64 MB dictionary.
If no modifier is present, megabytes are assumed for -md&lt;size&gt;
and gigabytes for -mdx&lt;size&gt; switch, so -md64m and -md64
or -mdx8 and -mdx8g are equal.</p>

<p>Compression memory requirements vary depending on the dictionary size
and presence of long range search <a href="HELPSwMC.htm">-mcl</a> switch.
Rough estimate is 7x of dictionary size for 1 GB and 1.5x for 64 GB
dictionary.</p>

<p>When extracting, slightly more than a single dictionary size
is allocated.</p>

<p>If size of all source files for solid archive or size of largest
source file for non-solid archive is at least twice less than dictionary size,
WinRAR can reduce the dictionary size. It helps to lower memory usage
without decreasing compression.</p>

<p>Default sliding dictionary size is 32 MB.</p>

<P>ZIP archives created by WinRAR always use 32 KB dictionary.</P>

<P>Dictionary size can also be selected in
<a href="HELPGetArcGeneral.htm#DictSize">Dictionary size</a> list
in "Archive name and parameters" dialog.</P>

<h1><B>Example</B></h1>

<P>create a solid archive in RAR 5.0 format with 128 MB dictionary</P>

<p class="sample">WinRAR a -s -md128 lib *.dll</p>

</BODY>
</HTML>
